package com.dayu.common.exception;

/**
 * @author dayu
 * @version 1.0
 * @email dayu007@foxmail.com
 * @date 2020/12/6 22:02
 * @description 错误码列表
 * 10\、通用
 *      001：参数格式校验失败
 *      002短信发送频繁，请稍后重试
 * 11、商品
 * 12、订单
 * 13、购物
 * 14 、物流
 * 15、用户
 */
public enum BizCodeEnum {
    UNKNOW_EXCEPTION(10000,"未知系统异常"),
    VALID_EXCEPTION(10001,"参数格式校验失败"),
    SMS_CODE_EXCEPTION(10002,"短信发送频繁，请稍后重试"),
    PRODUCT_UP_EXCEPTION(11000,"商品上架错误"),
    USER_EXIST_EXCEPTION(15001,"用户名存在"),
    PHONE_EXIST_EXCEPTION(15002,"手机号存在"),
    LOGIN_PASSWORD_INVALID_EXCEPTION(15005,"用户名或密码错误"),
    NO_STOCK_EXCEPTION(20001,"库存不足"),
    ;

    private int code;
    private String msg;

    BizCodeEnum(int code,String msg){
        this.code=code;
        this.msg=msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
